# score = int(input('please enter your score: '))
# if score >= 85:
#     print('A')
# elif score >= 75:
#     print('B')
# elif score >= 65:
#     print('C')
# else:
#     print('D')

num = int(input("请输入一个年份："))
# if num % 4 == 0 and num % 100 != 0 or num % 400 == 0:
if (not num % 4 and num % 100) or (not num % 400):
    print(1)
else:
    print(0)